package com.lemobar.pay.model.alipay.response;

import com.lemobar.pay.constants.AliPayConstants;
import com.lemobar.pay.enums.AliPayMethodEnum;
import com.lemobar.pay.model.alipay.TradeFundBill;
import lombok.Data;

import java.util.Date;

/**
 * 退款查询
 * alipay.trade.fastpay.refund.query(统一收单交易退款查询)
 * 手机网站支付WAP https://opendocs.alipay.com/open/02ivbv (alipay.trade.fastpay.refund.query)
 * APP支付 https://opendocs.alipay.com/open/02e7gp (alipay.trade.fastpay.refund.query)
 * 付款码支付 https://opendocs.alipay.com/open/02ekft (alipay.trade.fastpay.refund.query)
 */
@Data
public class AlipayTradeFastpayRefundQueryResponse {
/*
    响应示例
            {
                "alipay_trade_fastpay_refund_query_response": {
                    "code": "10000",
                    "msg": "Success",
                    "trade_no": "2014112611001004680073956707",
                    "out_trade_no": "20150320010101001",
                    "out_request_no": "20150320010101001",
                    "refund_reason": "用户退款请求",
                    "total_amount": 100.2,
                    "refund_amount": 12.33,
                    "refund_status": "REFUND_SUCCESS",
                    "refund_royaltys": [
                        {
                            "refund_amount": 10,
                            "royalty_type": "transfer",
                            "result_code": "SUCCESS",
                            "trans_out": "2088102210397302",
                            "trans_out_email": "alipay-test03@alipay.com",
                            "trans_in": "2088102210397302",
                            "trans_in_email": "zen_gwen@hotmail.com"
                        }
                    ],
                    "gmt_refund_pay": "2014-11-27 15:45:57",
                    "refund_detail_item_list": [
                        {
                            "fund_channel": "ALIPAYACCOUNT",
                            "amount": 10,
                            "real_amount": 11.21,
                            "fund_type": "DEBIT_CARD"
                        }
                    ],
                    "send_back_fee": "88",
                    "deposit_back_info": {
                        "has_deposit_back": "true",
                        "dback_status": "S",
                        "dback_amount": 1.01,
                        "bank_ack_time": "2020-06-02 14:03:48",
                        "est_bank_receipt_time": "2020-06-02 14:03:48"
                    }
                },
                "sign": "ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"
            }
     */

    private AlipayTradeFastpayRefundQueryResponse.Content alipayTradeFastpayRefundQueryResponse;

    /**
     * 签名,详见文档  https://doc.open.alipay.com/docs/doc.htm?treeId=291&articleId=106074&docType=1
     */
    private String sign;


    @Data
    public static class Content {
        /**
         * 网关返回码,详见文档 https://doc.open.alipay.com/docs/doc.htm?treeId=291&articleId=105806&docType=1
         */
        private String code;

        /**
         * 网关返回码描述,详见文档 https://doc.open.alipay.com/docs/doc.htm?treeId=291&articleId=105806&docType=1
         */
        private String msg;

        /**
         * 业务返回码，参见具体的API接口文档
         */
        private String subCode;

        /**
         * 业务返回码描述，参见具体的API接口文档
         */
        private String subMsg;


        /**
         * 支付宝交易号
         */
        private String tradeNo;

        /**
         * 商家订单号
         */
        private String outTradeNo;

        /**
         * 本笔退款对应的退款请求号
         */
        private String outRequestNo;

        private String refundReason;
        private Double totalAmount;
        private Double refundAmount;
        private String refundStatus;
        private String refundRoyaltys;
        private Date gmtRefundPay;
        //private List<TradeFundBill> refundDetailItemList;
        private String sendBackFee;
        //private DepositBackInfo depositBackInfo;

    }
}
